﻿@using System.Configuration
@using System.Web.Script.Serialization
@using DataMongo
@using MVCMongo.Services
@model MVCMongo.ViewModel.FeedListViewModel

@{
    ViewBag.Title = "Breaking Hub";
    var serializer = new JavaScriptSerializer();
    var configUrl = ConfigurationManager.AppSettings["ImageLinkUrl"];
    Layout = "~/Views/Shared/_LayoutBreakingHome.cshtml";
}




                <div class="highlight-toolbar">
                    <div class="pull-left">
                        <div class="btn-toolbar">
                        </div>
                    </div>
                    <div class="pull-right">
                        <div class="btn-group">
                            <span>Showing results <strong>1-25</strong> of <strong>348</strong></span>
                        </div>
                    </div>
                </div>
                <div class="search-results">

                    <ul data-bind="foreach: posts">

                        <li>
                            <div class="thumbnail">
                                <a data-bind="attr: { href: LinkUrl }" class="hover-effect" target="_blank"><img data-bind="attr: { src: Imageurl }" height="100px" width="80px" /></a>
                            </div>
                            <div class="search-info">
                                <a data-bind="attr: { href: LinkUrl }" target="_blank" style="padding-right: 10px"><span data-bind="text:Title"></span></a>
                                <p class="url" data-bind="text:SourceId"></p>
                                <p class="feeddescription" data-bind="html:ShortDescription"></p>

                            </div>

                            <div class="postFooter" style="padding-left: 53px">
                                <a class="linkComment" href="#">Like</a>&nbsp;&nbsp; <a class="commentcount" href="#" data-bind="text:CommentCount"></a> &nbsp;&nbsp;<span class="timeago"></span>
                                <span>


                                    <a data-bind="attr: { href: FbShareLink }" class="icon-facebook-sign" style="font-size: 15px"></a>
                                    <a data-bind="attr: { href: TwitterShareLink }" class="icon-twitter-sign" style="font-size: 15px"></a>


                                </span>
                                @if (Request.IsAuthenticated)
                                {
                                    <div class="commentSection">
                                        <ul data-bind="foreach: PostComments">
                                            <li class="commentHolder">
                                                <img data-bind="attr: { src: CommentedByAvatar }" height="50px" width="50px" style="float: left"><p><a data-bind="text: CommentedBy" style="padding-left: 10px"></a>: <span data-bind="    html: Description"></span></p>
                                                <div class="commentFooter"> <span class="timeago" data-bind="text: CommentedOn" style="padding-left: 10px"></span>&nbsp;</div>
                                            </li>
                                        </ul>
                                        <div style="display: block; padding-top: 10px;" class="publishComment">
                                            <textarea class="commentTextArea" data-bind="value: newCommentMessage, jqAutoresize: {}" placeholder="write a comment..."></textarea>
                                            <input type="button" value="Comment" class="btnComment" data-bind="click: addComment" />
                                        </div>
                                    </div>
                                }

                            </div>
                        </li>

                    </ul>


                </div>
                <div class="highlight-toolbar bottom">
                    <div class="pull-left">
                        <div class="btn-toolbar">

                        </div>
                    </div>
                    <div class="pull-right">
                        <div class="btn-group">
                            <span>Showing results <strong>1-25</strong> of <strong>348</strong></span>
                        </div>
                    </div>
                </div>
     

<script type="text/javascript">

    function clearJumpTags() {
        var list = document.querySelectorAll(".jumpTag");
        var virallist = document.querySelectorAll(".mf-viral");
        var anchortaglist = document.querySelectorAll(".feeddescription a");
        var breaktaglist = document.querySelectorAll(".feeddescription br");
        var imgtaglist = document.querySelectorAll(".feeddescription img");
        $.each(breaktaglist, function () {
            $(this).remove();
        });

        $.each(imgtaglist, function () {
            $(this).remove();
        });

        $.each(virallist, function () {
            $(this).remove();
        });

        $.each(anchortaglist, function () {
            $(this).remove();
        });
        $.each(list, function () {
            $(this).remove();
        });
        $.unblockUI();
        $(".Hot").closest("li").addClass("active");
    };

    function popup_share(url, width, height) {
        day = new Date();
        id = day.getTime();
        eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=" + width + ", height=" + height + ", left = 363, top = 144');");
    }

    $(".btnComment").live("click", function () {
        var countText = $(this).closest(".postFooter").find(".commentcount").text();
        var splitdata = countText.split("(")[1].split(")")[0];
        var count = parseInt(splitdata) + 1;
        $(this).closest(".postFooter").find(".commentcount").text("Comment ( " + count + " )");
    });

</script>



<style>
    .search-results .commentSection ul li:nth-child(2n) {
        background: none repeat scroll 0 0 #EEF1F6;
    }
</style>

<script type="text/javascript">
    var feedtype = @serializer.Serialize(3);
    var CategoryId = @serializer.Serialize(0);
</script>

<script src="~/Scripts/jquery.autosize-min.js"></script>
<script src="~/Scripts/jquery.timeago.js"></script>
<script src="~/Scripts/knockout-2.2.0.js"></script>
<script src="~/Scripts/HomeFeed.js"></script>